import request from '@/utils/request'

export function login(data) {
  return request({
    url: '/sec/v1/auth/login',
    method: 'post',
    data
  })
}

export function getInfo() {
  return request({
    url: '/sec/v1/auth/info',
    method: 'get'
  })
}

export function logout() {
  return request({
    url: '/sec/v1/auth/logout',
    method: 'delete'
  })
}

export function list(params) {
  return request({
    url: '/sec/v1/users',
    method: 'get',
    params
  })
}

export function create(data) {
  return request({
    url: '/sec/v1/users',
    method: 'post',
    data
  })
}

export function update(data) {
  return request({
    url: '/sec/v1/users',
    method: 'put',
    data
  })
}

export function remove(data) {
  return request({
    url: '/sec/v1/users',
    method: 'delete',
    data
  })
}

